package com.iss.lxhproject.dao;

import com.iss.lxhproject.entity.User;
import com.iss.lxhproject.model.UserWithRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import javax.jws.soap.SOAPBinding;

@Repository
@Mapper
public interface UserDao {
    @Select("select u_id,u_name,r_name,r_id from user inner join userRole on u_roleid=r_id where u_name=#{u_name} and u_psd=#{u_psd}")
    UserWithRole login(User user);
    @Insert("insert into user values #{u_id},#{u_name},#{u_psd}")
    Integer register(User user);
    @Select("select * from user where u_name=#{u_name}")
    public User CheckUserNameExit(String u_name);
}
